package com.hxf.dao.user; 

import java.util.List;

import com.hxf.dao.BaseDao;
import com.hxf.dto.AdminRoleDto;
import com.hxf.dto.RoleDto;
import com.hxf.dto.UserDto;
import com.hxf.exception.DaoLevelException;

/**
 * DAO会员接口
 * 
 * @author tengyicheng
 * @version [1.0, 2013/09/23]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public interface UserDao extends BaseDao {
	/**
	 * 分页查询会员信息
	 * @param userDto
	 * @param targetPage
	 * @param pageSize
	 * @return
	 * @throws DaoLevelException
	 */
	public List<UserDto> findByUser(UserDto userDto, int targetPage, int pageSize)throws DaoLevelException;
	
	/**
	 * 查询会员信息
	 * @param userDto
	 * @param targetPage
	 * @param pageSize
	 * @return
	 * @throws DaoLevelException
	 */
	public List<UserDto> findByUser(UserDto userDto)throws DaoLevelException;
	
	/**
	 * 查询已绑定的角色
	 * @param urDto
	 * @return
	 * @throws DaoLevelException
	 */
	public List<RoleDto> findByUserRole(AdminRoleDto urDto)throws DaoLevelException;
	
	/**
	 * 根据会员id 删除用户关联的角色
	 * @param userId
	 * @return
	 * @throws DaoLevelException
	 */
	public int deleteUserRoleByUserId(Integer userId)throws DaoLevelException;
	
	/**
	 * 用户登录验证
	 * @param userDto
	 * @return
	 * @throws DaoLevelException
	 */
	public int loginUser(UserDto userDto)throws DaoLevelException;
	
	/**
	 * 验证用户名是否注册
	 * @param userName
	 * @return
	 * @throws DaoLevelException
	 */
	public boolean validateUserName(String userName)throws DaoLevelException;
	
	/*
	 * 查询 登陆用户的角色
	 */
	public AdminRoleDto selectUserRole(Integer userId) throws DaoLevelException;
	
	//检验用户是否为 超级管理员
	public UserDto selectUserOrAdmin(Integer userId) throws DaoLevelException;
}
